package com.numbfish.ch01_ex01_bean_resister.config;

import com.numbfish.ch01_ex01_bean_resister.pojo.Dog;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CustomAutoConfigurationBefore {


    @Configuration
    public class CustomConfig1 {
        public CustomConfig1() {
            System.out.println("CustomConfig1 constructor is called");
        }
        @Bean
        public Dog dog() {
            return new Dog();
        }
    }

    @Configuration
    @AutoConfigureBefore({CustomConfig1.class})
    public class CustomConfig2 {
        public CustomConfig2() {
            System.out.println("CustomConfig2 constructor is called");
        }
    }
}


